package game.test;

import java.io.IOException;

import entity.map.FieldEntityMap;
import game.engine.network.client.ClientServer;
import game.game.ControllerGameView;
import game.game.GameModel;
import game.game.network.client.ControllerClient;

import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.SlickException;

public class MainGame
{

	public static void main( String[] args ) throws SlickException, IOException
	{
		// init du model
		GameModel model = new GameModel();
		ClientServer server = new ClientServer();
		ControllerGameView controllerView = new ControllerGameView( model, server );
		//
		model.setMap( new FieldEntityMap( 100, 100 ) );

		ControllerClient controller = new ControllerClient( model, server );
		server.setController( controller );
		server.startServer( model );
		// affichage de la vue
		AppGameContainer app = new AppGameContainer( new GameView( "Game", model, controllerView ) );
		app.setTargetFrameRate( 60 );
		app.setDisplayMode( 640 , 640 , false );
		app.start();

	}

}
